#include<iostream> 
#include<stdio.h>
#include<cstdlib>
#include<string.h>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
   char s[100] ;
   int i;
   while(cin>>s){
    if(s[0]=='!')  break;
    for(i=0;i<strlen(s);i++)
    {
       if( s[i]>='a'&&s[i]<='z' ) 
           {
               cout<<abs(s[i]-'a')<<" "<<abs(127-(int)s[i]-(int)'z')<<endl;
               if( abs(s[i]-'a')==abs(127-(int)s[i]-(int)'z') )  cout<<(char)(127-s[i]);
               else cout<<s[i];
           }
       else if( s[i]>='A'&&s[i]<='Z' ) 
           {
               if( abs(s[i]-'a')==abs(127-(int)s[i]-(int)'z') )  cout<<(char)(127-s[i]);
               else cout<<s[i];
           }
       else cout<<s[i];
    }
   }
   return 0;
} 
